import { Main } from 'element-ui'

import Vue from 'vue'
import Router from 'vue-router'
import login from "../components/login"
import main from "../components/mainhome"
import in1 from "../components/in1"
import in2 from "../components/in2"
import object1 from "../components/object1"
import spend1 from "../components/spend1"
import spend2 from "../components/spend2"
import company from "../components/company"


Vue.use(Router)

export default new Router({
  routes: [
    {//如果访问的是/，进行重定向进入login页面中
      path: '/',
      redirect: '/login'
    },
    {
      //路由跳转路径
      path: '/login',
      //路由名称
      name: 'login',
      //路由跳转组件
      component: login
    },
    {
      //路由跳转路径
      path: '/mainhome',
      //路由名称
      name: 'mainhome',
      //路由跳转组件
      component: main,
      children:[{
        path:'/in1',
        name:'in1',
        component:in1
      },{
        path:'/in2',
        name:'in2',
        component:in2
      },{
        path:'/object1',
        name:'object1',
        component:object1
      },{
        path:'/company',
        name:'company',
        component:company
      },{
        path:'/spend1',
        name:'spend1',
        component:spend1
      },{
        path:'/spend2',
        name:'spend2',
        component:spend2
      }
    ]
    }
  ]
})
